﻿@{
    ViewBag.Title = "设置参数";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head{
    <script src="http://cdn.staticfile.org/jquery/2.1.0/jquery.min.js"></script>
    <style>
        div.row {
            height: 30px;
        }

        .sumbit {
            border: 1px solid #000;
            background-color: #0ff0ff;
            width: 100px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            cursor: pointer;
        }

        .qrCodeImages {
            width: 431px;
            height: 431px;
            border: 1px solid red;
        }
    </style>
    <script>
        $(function () {
            $("#sumbit").click(function () {
                var qrCodeType = $("input[name='qrCodeType']:checked").val();
                var sceneValue = $("#sceneValue").val();
                if (sceneValue == "") {
                    alert("为必填项！");
                }
                $.post("/Home/GetQrCode", { isTemp: qrCodeType, sceneValue: sceneValue }, function (responseData) {
                    $("#qrCodeImages").html("<img src='" + responseData + "' alt='二维码' />");
                });
            });
        });
    </script>
}
<div class="row">
    <label>二维码类型：</label><input id="temp" name="qrCodeType" type="radio" value="true" checked="checked" /><label for="temp">临时二维码</label>
    <input id="forever" name="qrCodeType" type="radio" value="false" /><label for="forever">永久二维码</label>
</div>
<div class="row">
    <label>场景值:</label>
    <input type="number" id="sceneValue" name="sceneValue" value="1" />
</div>
<div class="row">
    <div id="sumbit" class="sumbit">提交</div>
</div>
<div>
    <label>二维码：</label>
    <div id="qrCodeImages" class="qrCodeImages"></div>
</div>
